﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/Base/IndexBase.master" CodeFile="~/Pages/Base/IndexBase.cs" Inherits="IndexBasePage" %>

<script runat="server">
    private StateGrid.KCBG.KCBG_DAO dao;
    
    protected override void DoInit()
    {
        dao = new StateGrid.KCBG.KCBG_DAO();
    }

    protected override List<StateGrid.Catalog> GetCatalogs()
    {
        var query = from source in dao.GetAllKCBG_FL()
                    select new StateGrid.Catalog() { Code = source.flbm, Name = source.flmc, Description = source.flsm };

        return query.ToList();   
    }

    protected override bool IsLeafCatalog(string catalog)
    {
        if (((StateGrid.User.User)Session["login"]).role == StateGrid.User.UserRole.NORMAL)
        {
            return true;
        }
        return catalog.Length >= 4;
    }

    protected override string GetListItemPageURL()
    {
        return StateGrid.GlobalVariables.GlobalKCBG.LISTPM_PAGE;
    }

    protected override string GetAddCatalogPageURL()
    {
        return StateGrid.GlobalVariables.GlobalKCBG.ADDFL_PAGE;
    }
    
</script>

<%-- Add content controls here --%>
